package com.wizo.csb.records.exporter;

import java.io.BufferedWriter;
import java.io.IOException;
import java.io.OutputStream;
import java.io.OutputStreamWriter;

public class TextRecordsExporter implements RecordsExporter{
	private BufferedWriter writer;
	
	public TextRecordsExporter(OutputStream out){
		writer = new BufferedWriter(new OutputStreamWriter(out));
	}
	
	public void write(String measurement, int content) throws IOException{
		writer.write(measurement+": "+content);
		writer.newLine();
	}
	
	public void write(String measurement, double content) throws IOException{
		writer.write(measurement+": "+content);
		writer.newLine();
	}
	
	public void write(String measurement, String content) throws IOException{
		writer.write(measurement+": "+content);
		writer.newLine();
	}
	
	public void write(String content) throws IOException{
		writer.write(content);
		writer.newLine();
	}
	
	public void close() throws IOException{
		writer.close();
	}
}
